define(["jquery", "easy-admin"], function ($,ea) {

    var Controller = {
        listen : function (id,len) {
            if(id){
                //监听按钮提示
                $('#'+id).click(function () {
                    if(!len) len = $('#'+id).attr('data-input-name');//document.getElementById(botton_id).dataset.inputName;
                    var data = $("input[name='"+len+"']").val();
                    var index = ea.open('添加配送区域', '/manage/common/map?input_name='+len+'&value='+data, '100%', '100%');
                });
            }else{
                //监听按钮提示
                $('.add-city-create').click(function () {
                    if(!len) len = $(this).attr('data-input-name');//document.getElementById(botton_id).dataset.inputName;
                    var data = $("input[name='"+len+"']").val();
                    var index = ea.open('添加配送区域', '/manage/common/map?input_name='+len+'&value='+data, '100%', '100%');
                });

            }

    },
    };
    return Controller;
});